<?php
/**
 * Created by PhpStorm.
 * User: 12133
 * Date: 2024/1/13
 * Time: 9:35
 */

namespace app\model\admin;


use think\model\concern\SoftDelete;

class User extends Base
{
    use SoftDelete;
    protected $append = [
        'status_text'
    ];

    public $status_text = [
        1 => '正常',
        2 => '禁用',
        3 => '过期'
    ];
    public function getStatusTextAttr($value,$data){
        return $this->status_text[$data['status']];
    }

    public function getEndTimeAttr($value){
        if (empty($value))return '';
        return date('Y-m-d',strtotime($value));
    }
}